package com.example.graduatetest.activitys;

import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.lifecycle.ViewModelProviders;

import android.os.Bundle;

import com.example.graduatetest.R;
import com.example.graduatetest.databinding.ActivityAddClasssBinding;
import com.example.graduatetest.view.model.AddClassViewModel;

public class AddClassActivity extends AppCompatActivity {
    ActivityAddClasssBinding binding;
    AddClassViewModel addClassViewModel;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_add_classs);
        //隐藏ActionBar
        if(getSupportActionBar() != null){
            ActionBar actionBar = getSupportActionBar();
            actionBar.hide();
        }

        binding = DataBindingUtil.setContentView(this,R.layout.activity_add_classs);

        //LiveData
        addClassViewModel = ViewModelProviders.of(this).get(AddClassViewModel.class);
        binding.setAddClassViewModel(addClassViewModel);
        binding.setLifecycleOwner(this);
        addClassViewModel.init(this,binding);
    }
}
